<template>
  <div class="rich-content-outer">
    <div class="rich-content-wrapper">
      <div class="rich-content" v-html="content"></div>
    </div>
  </div>
</template>


<script>
export default {
  name: 'RichContentModule',
  props: {
    content: {
      type: String,
      default: ''
    }
  }
}
</script>

<style scoped>
.rich-content-outer {
  background-color: rgb(242, 246, 252);
  padding: 10px 10px;
  display: flex;
  justify-content: center;
}

.rich-content-wrapper {
  background-color: white;
  border-radius: 8px;
  max-width: 640px;
  width: 100%;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* 富文本内容本体 */
.rich-content {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  text-align: left; /* 文本左对齐 */
}

/* 图片样式 */
.rich-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px auto; /* 水平居中 */
  border-radius: 4px;
}

/* 视频样式 */
.rich-content video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto; /* 自动左右居中 */
  border-radius: 6px;
  background-color: #000;
}

/* 紧凑段落样式 */
.rich-content p {
  margin: 4px 0;
}
</style>
